<% content_for :page_actions do %>
  <% if @return_authorization.can_cancel? %>
    <%= button_link_to Spree.t('actions.cancel'), cancel_admin_order_return_authorization_url(@order, @return_authorization), method: :put, data: { confirm: Spree.t(:are_you_sure) }, icon: "delete.svg" %>
  <% end %>
<% end %>

<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :return_authorizations } %>

<% content_for :page_title do %>
  / <%= link_to Spree.t(:return_authorizations), spree.admin_order_return_authorizations_url %>
  / <%= @return_authorization.number %> (<%= Spree.t(@return_authorization.state.downcase) %>)
<% end %>

<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @return_authorization } %>

<%= form_for [:admin, @order, @return_authorization] do |f| %>
  <fieldset>
    <%= render partial: 'form', locals: { f: f } %>

    <div class="form-actions" data-hook="buttons">
      <%= button Spree.t('actions.update'), 'save.svg' %>
      <span class="or"><%= Spree.t(:or) %></span>
      <%= button_link_to Spree.t('actions.cancel'), spree.admin_order_return_authorizations_url(@order), icon: 'cancel.svg' %>
    </div>
  </fieldset>
<% end %>
